<!--
* @Authoer: weimei
* @Description: 数据权限管理
* @Date 2017/12/23
* @Modified By:
-->
<div id="dataAuthManage">
	<yu-panel :title="$t('dataAuthManage.sjqxgl')">
		<el-row :gutter="10">
			<el-col :span="5">
				<yufp-ext-tree ref="dataAuthTree" @node-click="nodeClickFn" :show-checkbox="false" :height="height" :data-url="treeUrl" data-id="nodeId"
				 data-label="nodeName" :render-content="renderContent" data-pid="upTreeId" data-root="0" lazy :load-node-method="load"
				 style="margin-top: 10px;" :highlight-current="true" accordion :expand-level="1"></yufp-ext-tree>
			</el-col>
			<el-col :span="19">
				<yu-xform v-model="formdata" related-table-name="dataTable" form-type="search" label-width="135px">
					<yu-xform-group :column="4">
						<yu-xform-item :label="$t('dataAuthManage.sjqxmb')" :placeholder="$t('dataAuthManage.sjqxmb')" ctype="input" name="authTmplName"></yu-xform-item>
						<yu-xform-item :label="$t('dataAuthManage.sjqxtj')" :placeholder="$t('dataAuthManage.sjqxtj')" ctype="input" name="sqlString"></yu-xform-item>
					</yu-xform-group>
				</yu-xform>
				<yu-toolBar>
					<el-button @click="dataAddFn" v-if="createCheck">{{ $t('dataAuthManage.xz') }}</el-button>
					<el-button @click="modifyFn" v-if="modifyCheck">{{ $t('dataAuthManage.xg') }}</el-button>
					<el-button @click="dataDeleteFn" v-if="deleteCheck">{{ $t('dataAuthManage.sc') }}</el-button>
				</yu-toolBar>
				<el-table-x ref="dataTable" :checkbox="true" :data-url="dataAuthUrl" :table-columns="dataTableColumns"></el-table-x>
				<el-dialog-x :center="true" :title="viewTitle[viewType]" :visible.sync="dialogVisible" height="150px">
					<el-form-x ref="dataForm" :group-fields="dataFields" :buttons="dataFormButtons" :disabled="formDisabled" label-width="120px"></el-form-x>
				</el-dialog-x>
			</el-col>
		</el-row>
	</yu-panel>
	<el-dialog-x :center="true" class="tmpldialog" :title="$t('dataAuthManage.kysjqxmb')" :visible.sync="tmplDialogVisible" width="500px"
	 height="550px">
		<yu-xform v-model="tmplFormdata" related-table-name="tmplTable" form-type="search">
			<yu-xform-group :column="2">
				<yu-xform-item :label="$t('dataAuthManage.sjqxmb')" :placeholder="$t('dataAuthManage.sjqxmb')" ctype="input" name="authTmplName"></yu-xform-item>
			</yu-xform-group>
		</yu-xform>
		<el-table-x ref="tmplTable" :data-url="tmplUrl" :table-columns="tmplTableColumns" :checkbox="true"></el-table-x>
		<div slot="footer" class="dialog-footer">
			<el-button type="primary" @click="getTmpl">{{ $t('dataAuthManage.qd') }}</el-button>
			<el-button @click="tmplDialogVisible=false">{{ $t('dataAuthManage.qx') }}</el-button>
		</div>
	</el-dialog-x>
</div>
<style>
	.tmpldialog>div {
		top: calc(50% - 342px) !important;
		margin-bottom: 0px !important;
	}
</style>